<template>
  <div class="page4">
    <button @click="throttledMethod()">Click me as fast as you can!</button>
  </div>
</template>

<script>
// import debounce from "lodash/debounce"; //导入loadsh插件
import _ from 'lodash'
export default {
  methods: {
    throttledMethod: _.debounce(() => {
      console.log("I get fired every two seconds!");
    }, 500),
  },
  mounted() {
    this.$nextTick(() => {
      console.log("_", _);
    });
  },
};
</script>

<style lang="scss" scoped>
.page4 {
  margin-top: 200px;
}
</style>